package com.atstudy.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/2/2 10:09
 * @copyright: 博为峰
 */
public class FilterDemo01 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("FilterDemo01 init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("FilterDemo01 doFilter");
        filterChain.doFilter(servletRequest, servletResponse);//放行
    }

    @Override
    public void destroy() {
        System.out.println("FilterDemo01 destroy");
    }
}
